if else solution in python in hackerrank